//
//  BaseViewController.m
//  Chirismus
//
//  Created by wangning on 15/11/2.
//  Copyright © 2015年 mohe. All rights reserved.
//

#import "BaseViewController.h"
#import "Define.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setBackNavBar];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated{
    delegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
    [delegate.tabBar hideTabBar];
}

- (void)setBackNavBar{
    UIButton *backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 10*F_WIDTH, 18*F_HEIGHT)];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"返回键"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *backBar = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = backBar;
}
- (void)back{
    [self.navigationController popViewControllerAnimated:YES];
}

@end
